<template>
    <view>
        <!-- template对应的原始代码，为保证正常显示，已对其进行隐藏。 -->
        <block name="calendarIndexTpl" v-if="false">
            <view v-if="isLoad === null" class="margin-top load notexist text-l load-project"></view>
            <view v-if="isLoad === false" class="margin-top load loading text-l load-project"></view>

            <view :class="'main ' + (skin.IS_SUB ? 'sub-margin-bottom' : '')" v-if="isLoad">
                <view class="plan-date">
                    <cmpt-calendar mode="one" :hasDays="hasDays" @click="bindClickCmpt" @monthChange="bindMonthChangeCmpt" />
                </view>

                <view class="list padding-project">
                    <view v-if="list === null" class="load loading text-l text-grey"></view>
                    <text v-else-if="list.length == 0" class="no-project icon-emoji text-l text-grey">本日没有可预约的项目哦~</text>
                    <view class="item card-project shadow-project" @tap="url" :data-url="'../../meet/detail/meet_detail?id=' + item._id" v-for="(item, index) in list" :key="index">
                        <view v-if="index % 4 == 0" class="left bg-blue"></view>

                        <view v-else-if="index % 4 == 1" class="left bg-green"></view>

                        <view v-else-if="index % 4 == 2" class="left bg-orange"></view>

                        <view v-else class="left bg-cyan"></view>

                        <block v-if="item.pic">
                            <image class="img loading" :src="item.pic" :lazy-load="true" mode="aspectFill" />
                        </block>

                        <view class="title text-cut">{{ item.title }}</view>

                        <view class="time">
                            <text class="icon-time margin-right-xxs"></text>
                            {{ item.timeDesc }}
                        </view>
                    </view>
                </view>
            </view>

            <block v-if="skin.IS_SUB">
                <!-- parse <template is="menuTpl" :data="skin,curMenu:'calendar_index'"/> -->
                <block name="menuTpl">
                    <view class="tab-bar">
                        <view v-if="returnHome" class="tab-bar-home" @tap="url" data-type="relaunch" data-url="/pages/home/index/home_index">
                            <text class="icon-homefill text-grey"></text>
                        </view>

                        <view class="tab-bar-border"></view>
                        <view class="tab-bar-item" @tap="url" data-type="relaunch" data-url="../../default/index/default_index">
                            <image class="tab-icon" :src="'../../skin/images/tabbar/home' + ('calendar_index' == 'home_index' ? '_cur' : '') + '.png'"></image>
                            <view :class="'tab-text ' + ('calendar_index' == 'home_index' ? 'text-project' : '')">{{ skin.MENU_ITEM[0] }}</view>
                        </view>

                        <view class="tab-bar-item" @tap="url" data-type="relaunch" data-url="../../news/cate1/news_cate1">
                            <image class="tab-icon" :src="'../../skin/images/tabbar/cate1' + ('calendar_index' == 'news_cate1' ? '_cur' : '') + '.png'"></image>
                            <view :class="'tab-text ' + ('calendar_index' == 'news_cate1' ? 'text-project' : '')">{{ skin.newsCateArr[0].label }}</view>
                        </view>

                        <view class="tab-bar-item" @tap="url" data-type="relaunch" data-url="../../news/cate2/news_cate2">
                            <image class="tab-icon" :src="'../../skin/images/tabbar/cate2' + ('calendar_index' == 'news_cate2' ? '_cur' : '') + '.png'"></image>
                            <view :class="'tab-text ' + ('calendar_index' == 'news_cate2' ? 'text-project' : '')">{{ skin.newsCateArr[1].label }}</view>
                        </view>

                        <view class="tab-bar-item" @tap="url" data-type="relaunch" data-url="../../calendar/index/calendar_index">
                            <image class="tab-icon" :src="'../../skin/images/tabbar/day' + ('calendar_index' == 'calendar_index' ? '_cur' : '') + '.png'"></image>
                            <view :class="'tab-text ' + ('calendar_index' == 'calendar_index' ? 'text-project' : '')">{{ skin.MENU_ITEM[1] }}</view>
                        </view>
                        <view class="tab-bar-item" @tap="url" data-type="relaunch" data-url="../../my/index/my_index">
                            <image class="tab-icon" :src="'../../skin/images/tabbar/my' + ('calendar_index' == 'my_index' ? '_cur' : '') + '.png'"></image>
                            <view :class="'tab-text ' + ('calendar_index' == 'my_index' ? 'text-project' : '')">{{ skin.MENU_ITEM[2] }}</view>
                        </view>
                    </view>
                </block>
            </block>
        </block>
    </view>
</template>

<style>
@import './calendar_index_tpl.css';
@import 'undefined';
</style>
